const events = require("events")
const event = new events()

//2.监听某一个事件
//on
//addListener

const click1 = (args) => {
  console.log('click', args);
}
event.on('click', click1)
event.on('click', (args) => {
  console.log('click2', args);
})

//3.发出一个事件
setTimeout(() => {
  event.emit("click", "zyw", "666")
  event.off("click", click1)
  event.emit("click", "zyw", "666")
}, 2000);